<template>
  <!-- 阶段/类别完成情况 -->
  <a-modal class="approval-dialog" title="阶段/类别完成情况" :visible="visible" width="900px" @ok="handleOk" @cancel="handleCancel">
    <p><span v-if="!isSetupComplete">该节点为当前阶段/类别下最后一个节点，该节点完成后，其父级任务是否已全部完成？</span><span style="color: #ff0000">若选择是，则该父级节点不再生成至下周计划中。</span></p>
    <a-form-model ref="ruleForm" :model="form" :label-col="{ lg: { span: 6 }, sm: { span: 6 } }" :wrapper-col="{ lg: { span: 18 }, sm: { span: 18 } }">
      <a-form-model-item>
        <span>“{{rowName}}”是否全部完成：</span>
        <a-switch v-model="form.completeStatus"  checked-children="是" un-checked-children="否"/>
      </a-form-model-item>
    </a-form-model>
  </a-modal>
</template>
<script>
export default {
  name: 'searchTable',
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    isSetupComplete:{
      type: Boolean,
      default: false
    },
    rowName:{
      type: String,
      default: ''
    }
  },
  data() {
    return {
      form: {
        completeStatus: false,
      },
    }
  },
  methods: {
    handleOk(){
      this.$emit('update:visible', false)
      this.$emit('submit', this.form,true)
    },
    handleCancel() {
      this.$emit('update:visible', false)
      this.$emit('submit', this.form,false)
    }
  }
}
</script>
<style lang="less" scoped>
@deep: ~'>>>';
.approval-dialog{
  @{deep} .ant-form-item .ant-form-item-label{
    width: 200px;
  }
  @{deep} .ant-form-item .ant-form-item-control-wrapper{
    width: calc(100% - 200px);
  }
}
</style>
